import mongoose from '../dbHelper';
import {defaultSchemaExtend, defaultSchemaOptions} from "../config/index";

const Schema = mongoose.Schema;

const RefundSchema = new Schema(Object.assign({
    app_id: String,
    ShopId: Number,
    OrderId: String,
    AftersaleId: String,
    RefundStatus: Number,
    RefundAmount: Number,
    Reason: String,
    Remark: String,
    refundStatusIs: Number, // 0申请未退款 1已退款
    // app_id: String,
    // order_id: String,
    // service_start_time: Number,
    // service_end_time: Number,
    // status: Number,
    // phone: String,
    // pay_amount: Number,
    // pay_time: Number,
    // order_create_time: Number,
    // pay_type: Number,
    // push_sku_info:  new Schema(Object.assign({
    //     spec_type: Number,
    //     spec_value: String,
    //     price: Number,
    //     duration: Number,
    //     duration_unit: Number,
    //     title: String
    // }))
    // menber_status: {
    //     type: Number,
    //     default: 0, // 0 自行安装未授权用户 1 已授权试用 3 已经购买 检查到期时间
    // },
    // menber_outtime: String, // 使用过期时间未来时间戳
}, defaultSchemaExtend), defaultSchemaOptions);

const Refund = mongoose.model('Refund', RefundSchema, 'Refunds');

export default Refund